package com.smart.village.big.screen.controller.bigscreen;

import com.smart.village.big.screen.domain.AjaxResult;
import com.smart.village.big.screen.service.ACTService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 数智农文旅数据接口
 */
@Tag(name = "数智农文旅数据接口")
@RestController
@RequestMapping("/agriculture/cultural/tourism")
public class ACTController {
    @Autowired
    private ACTService actService;

    @Operation(summary = "景区与住宿-民宿概况")
    @Parameters({
            @Parameter(name = "townNumber", description = "镇编码 必传"),
            @Parameter(name = "villageNumber", description = "村编码 必传"),
    })
    @GetMapping("/getHomestayIntroduction")
    @ResponseBody
    public AjaxResult getHomestayIntroduction(
            @RequestParam(required = false) String townNumber,
            @RequestParam(required = false) String villageNumber,
            @RequestParam(required = false, defaultValue = "1") @Parameter(description = "当前页数") int pageNum,
            @RequestParam(required = false, defaultValue = "10") @Parameter(description = "每页条数") int pageSize
    ) {
        return AjaxResult.success(actService.getHomestayIntroduction(townNumber, villageNumber, pageNum, pageSize));
    }

    @Operation(summary = "景区与住宿-点位信息-图例")
    @Parameters({
    })
    @GetMapping("/getAllHomestayMerchantCategories")
    @ResponseBody
    public AjaxResult getAllHomestayMerchantCategories(

    ) {
        return AjaxResult.success(actService.getAllHomestayMerchantCategories());
    }

    @Operation(summary = "景区与住宿-点位信息")
    @Parameters({
            @Parameter(name = "townNumber", description = "镇编码 必传"),
            @Parameter(name = "villageNumber", description = "村编码 必传"),
            @Parameter(name = "merchantCategorySerialNumber", description = "商户分类序列号 非必填"),
    })
    @GetMapping("/getHomestayIntroductionCoordsList")
    @ResponseBody
    public AjaxResult getHomestayIntroductionCoordsList(
            @RequestParam(required = false) String townNumber,
            @RequestParam(required = false) String villageNumber,
            @RequestParam(required = false) String merchantCategorySerialNumber
    ) {
        return AjaxResult.success(actService.getHomestayIntroductionCoordsList(townNumber, villageNumber, merchantCategorySerialNumber));
    }

    @Operation(summary = "服务资源-点位信息-图例")
    @Parameters({
            @Parameter(description = "标签序列号-非必填", name = "tagSerialNumber", required = false)
    })
    @GetMapping("/getAllBluePlateTags")
    @ResponseBody
    public AjaxResult getAllBluePlateTags(
            @RequestParam(required = false) @Parameter(description = "标签序列号") String tagSerialNumber
    ) {
        return AjaxResult.success(actService.getAllBluePlateTags(tagSerialNumber));
    }


    @Operation(summary = "服务资源-点位信息")
    @Parameters({
            @Parameter(name = "townNumber", description = "镇编码 必传"),
            @Parameter(name = "villageNumber", description = "村编码 必传"),
            @Parameter(description = "标签序列号-非必填", name = "tagSerialNumber", required = false)
    })
    @GetMapping("/getServiceResourcesCoordsList")
    @ResponseBody
    public AjaxResult getServiceResourcesCoordsList(
            @RequestParam(required = false) String townNumber,
            @RequestParam(required = false) String villageNumber,
            @RequestParam(required = false) @Parameter(description = "标签序列号") String tagSerialNumber
    ) {
        return AjaxResult.success(actService.getServiceResourcesCoordsList(townNumber, villageNumber, tagSerialNumber));
    }

    @Operation(summary = "景区住宿-重点旅游资源")
    @Parameters({

    })
    @GetMapping("/getImportentTourScence")
    @ResponseBody
    public AjaxResult getImportentTourScence(

    ) {
        return AjaxResult.success(actService.getImportentTourScence());
    }

    @Operation(summary = "景区住宿-景区实时视频")
    @Parameters({
            @Parameter(name = "pageNum", description = "页码 非 必传 默认1"),
            @Parameter(name = "pageSize", description = "每页数量 非 必传 默认10"),
    })
    @GetMapping("/getScenceVideo")
    @ResponseBody
    public AjaxResult getScenceVideo(
            @RequestParam(required = false, defaultValue = "1") int pageNum,
            @RequestParam(required = false, defaultValue = "10") int pageSize
    ) {
        return AjaxResult.success(actService.getScenceVideo(pageNum, pageSize));
    }

    @Operation(summary = "景区住宿-景区人数")
    @Parameters({

    })
    @GetMapping("/getScencePersonCnt")
    @ResponseBody
    public AjaxResult getScencePersonCnt(

    ) {
        return AjaxResult.success(actService.getScencePersonCnt());
    }

    @Operation(summary = "景区住宿-游客反馈")
    @Parameters({

    })
    @GetMapping("/getTouristFeedback")
    @ResponseBody
    public AjaxResult getTouristFeedback(

    ) {
        return AjaxResult.success(actService.getTouristFeedback());
    }

    @Operation(summary = "投诉处理-商家黑榜排名")
    @Parameters({

    })
    @GetMapping("/getBlacklistRanking")
    @ResponseBody
    public AjaxResult getBlacklistRanking(

    ) {
        return AjaxResult.success(actService.getBlacklistRanking());
    }


    @Operation(summary = "投诉处理-投诉类别")
    @Parameters({
            @Parameter(name = "townNumber", description = "镇编码 必传"),
            @Parameter(name = "villageNumber", description = "村编码非 必传"),
    })
    @GetMapping("/getComplaintCategory")
    @ResponseBody
    public AjaxResult getComplaintCategory(
            @RequestParam(required = false) String townNumber,
            @RequestParam(required = false) String villageNumber) {
        return AjaxResult.success(actService.getComplaintCategory(townNumber, villageNumber));
    }

    @Operation(summary = "投诉处理-网格区域投诉量")
    @Parameters({
            @Parameter(name = "townNumber", description = "镇编码 必传"),
            @Parameter(name = "villageNumber", description = "村编码非 必传"),
    })
    @GetMapping("/getComplaintGrid")
    @ResponseBody
    public AjaxResult getComplaintGrid(
            @RequestParam(required = false) String townNumber,
            @RequestParam(required = false) String villageNumber) {
        return AjaxResult.success(actService.getComplaintGrid(townNumber, villageNumber));
    }

    @Operation(summary = "投诉处理-举报事件")
    @Parameters({
            @Parameter(name = "townNumber", description = "镇编码 必传"),
            @Parameter(name = "villageNumber", description = "村编码非 必传"),
    })
    @GetMapping("/getComplaintEvent")
    @ResponseBody
    public AjaxResult getComplaintEvent(
            @RequestParam(required = false) String townNumber,
            @RequestParam(required = false) String villageNumber,
            @RequestParam(required = false, defaultValue = "1") int pageNum,
            @RequestParam(required = false, defaultValue = "10") int pageSize
    ) {
        return AjaxResult.success(actService.getComplaintEvent(townNumber, villageNumber, pageNum, pageSize));
    }

    @Operation(summary = "投诉处理-事件处理率")
    @Parameters({
            @Parameter(name = "townNumber", description = "镇编码 必传"),
            @Parameter(name = "villageNumber", description = "村编码非 必传"),
    })
    @GetMapping("/getComplaintEventRate")
    @ResponseBody
    public AjaxResult getComplaintEventRate(
            @RequestParam(required = false) String townNumber,
            @RequestParam(required = false) String villageNumber,
            @RequestParam(required = false, defaultValue = "1") int pageNum,
            @RequestParam(required = false, defaultValue = "10") int pageSize
    ) {
        return AjaxResult.success(actService.getComplaintEventRate(townNumber, villageNumber, pageNum, pageSize));
    }

    @Operation(summary = "投诉处理-处理满意率")
    @Parameters({
            @Parameter(name = "townNumber", description = "镇编码 必传"),
            @Parameter(name = "villageNumber", description = "村编码非 必传"),
    })
    @GetMapping("/getComplaintEventSuccessRate")
    @ResponseBody
    public AjaxResult getComplaintEventSuccessRate(
            @RequestParam(required = false) String townNumber,
            @RequestParam(required = false) String villageNumber,
            @RequestParam(required = false, defaultValue = "1") int pageNum,
            @RequestParam(required = false, defaultValue = "10") int pageSize
    ) {
        return AjaxResult.success(actService.getComplaintEventSuccessRate(townNumber, villageNumber, pageNum, pageSize));
    }

    @Operation(summary = "服务资源-游客反馈")
    @Parameters({

    })
    @GetMapping("/getServiceResourcesTouristFeedback")
    @ResponseBody
    public AjaxResult getServiceResourcesTouristFeedback(

    ) {
        return AjaxResult.success(actService.getServiceResourcesTouristFeedback());
    }

    @Operation(summary = "服务资源-紧急避险")
    @Parameters({
            @Parameter(name = "townNumber", description = "镇编码 必传"),
            @Parameter(name = "villageNumber", description = "村编码非 必传"),
    })
    @GetMapping("/getEmergencyDiversion")
    @ResponseBody
    public AjaxResult getEmergencyDiversion(
            @RequestParam(required = false) String townNumber,
            @RequestParam(required = false) String villageNumber,
            @RequestParam(required = false, defaultValue = "1") int pageNum,
            @RequestParam(required = false, defaultValue = "10") int pageSize
    ) {
        return AjaxResult.success(actService.getEmergencyDiversion(townNumber, villageNumber, pageNum, pageSize));
    }

    @Operation(summary = "服务资源-资源列表")
    @Parameters({
            @Parameter(name = "townNumber", description = "镇编码 必传"),
            @Parameter(name = "villageNumber", description = "村编码非 必传"),
            @Parameter(name = "resourceType", description = "资源类型 非 必传"),
    })
    @GetMapping("/getServiceResourcesList")
    @ResponseBody
    public AjaxResult getServiceResourcesList(
            @RequestParam(required = false) String townNumber,
            @RequestParam(required = false) String villageNumber,
            @RequestParam(required = false, defaultValue = "公共厕所") String resourceType,
            @RequestParam(required = false, defaultValue = "1") int pageNum,
            @RequestParam(required = false, defaultValue = "10") int pageSize
    ) {
        return AjaxResult.success(actService.getServiceResourcesList(townNumber, villageNumber, resourceType, pageNum, pageSize));
    }

    @Operation(summary = "服务资源-旅行社")
    @Parameters({
            @Parameter(name = "townNumber", description = "镇编码 必传"),
            @Parameter(name = "villageNumber", description = "村编码非 必传"),
    })
    @GetMapping("/getTravelAgency")
    @ResponseBody
    public AjaxResult getTravelAgency(
            @RequestParam(required = false) String townNumber,
            @RequestParam(required = false) String villageNumber,
            @RequestParam(required = false, defaultValue = "1") int pageNum,
            @RequestParam(required = false, defaultValue = "10") int pageSize
    ) {
        return AjaxResult.success(actService.getTravelAgency(townNumber, villageNumber, pageNum, pageSize));
    }

    @Operation(summary = "车流客流-拥堵分析")
    @Parameters({
            @Parameter(name = "dateType", description = "日期类型 非 必传 默认今日 today，昨天 yesterday"),
    })
    @GetMapping("/getTrafficFlowCongestionAnalysis")
    @ResponseBody
    public AjaxResult getTrafficFlowCongestionAnalysis(
            @RequestParam(required = false, defaultValue = "today") String dateType
    ) {
        return AjaxResult.success(actService.getTrafficFlowCongestionAnalysis(dateType));
    }

    @Operation(summary = "车流客流-客流量")
    @Parameters({
            @Parameter(name = "dateType", description = "日期类型 非 必传 默认今日 today，昨天 yesterday"),
    })
    @GetMapping("/getTrafficFlowPassengerAnalysis")
    @ResponseBody
    public AjaxResult getTrafficFlowPassengerAnalysis(
            @RequestParam(required = false, defaultValue = "today") String dateType
    ) {
        return AjaxResult.success(actService.getTrafficFlowPassengerAnalysis(dateType));
    }

    @Operation(summary = "车流客流-进车数量")
    @Parameters({
    })
    @GetMapping("/getInCarCnt")
    @ResponseBody
    public AjaxResult getInCarCnt(
    ) {
        return AjaxResult.success(actService.getInCarCnt());
    }

    @Operation(summary = "车流客流-车流监控")
    @Parameters({
            @Parameter(name = "pageNum", description = "页码 非 必传 默认1"),
            @Parameter(name = "pageSize", description = "每页数量 非 必传 默认10"),
    })
    @GetMapping("/getTrafficFlowVideo")
    @ResponseBody
    public AjaxResult getTrafficFlowVideo(
            @RequestParam(required = false, defaultValue = "1") int pageNum,
            @RequestParam(required = false, defaultValue = "10") int pageSize
    ) {
        return AjaxResult.success(actService.getTrafficFlowVideo(pageNum, pageSize));
    }

    @Operation(summary = "车流客流-客流监控")
    @Parameters({
            @Parameter(name = "pageNum", description = "页码 非 必传 默认1"),
            @Parameter(name = "pageSize", description = "每页数量 非 必传 默认10"),
    })
    @GetMapping("/getPersonFlowVideo")
    @ResponseBody
    public AjaxResult getPersonFlowVideo(
            @RequestParam(required = false, defaultValue = "1") int pageNum,
            @RequestParam(required = false, defaultValue = "10") int pageSize
    ) {
        return AjaxResult.success(actService.getPersonFlowVideo(pageNum, pageSize));
    }

    @Operation(summary = "车流客流-停车服务")
    @Parameters({

    })
    @GetMapping("/getParkingService")
    @ResponseBody
    public AjaxResult getParkingService(

    ) {
        return AjaxResult.success(actService.getParkingService());
    }
}
